import 'package:flutter/material.dart';

class DefaultEmptyIndicator extends StatelessWidget {
  const DefaultEmptyIndicator({super.key});

  @override
  Widget build(BuildContext context) {
    return const Center(
      child: Text(
        '暂无数据',
        style: TextStyle(
          color: Colors.white70,
          fontSize: 16,
        ),
      ),
    );
  }
}

///列表的空数据
class DefaultListEmptyIndicator extends StatelessWidget {
  const DefaultListEmptyIndicator({
    super.key,
    this.text,
  });

  final String? text;

  @override
  Widget build(BuildContext context) {
    return Center(
      child: Column(
        mainAxisAlignment: MainAxisAlignment.center,
        children: [
          Image.asset(
            'assets/images/empty.png',
            width: 90,
            height: 90,
          ),
          const SizedBox(height: 20),
          Text(
            text ?? '暂无数据',
            textAlign: TextAlign.center,
            style: const TextStyle(
                color: Colors.white70,
                fontSize: 14,
                fontWeight: FontWeight.w500),
          ),
        ],
      ),
    );
  }
}
